<?php foreach ($model as $key => $value) : ?>
	<div class="cat_list_item album_list_item">
		<?php if(Yii::app()->request->getParam('profile')==Yii::app()->user->id):?>
			<div class="u_media" >
				<?php if($value->main_photo!=NULL) echo $this->material_image($value->id, $value->main_photo->name, '180', 'photos/'.$value->user_id.'/'.$value->id); ?>
				<div class="mask hover hidden"></div>
				<div class="links hidden">
					<a href="<?php echo Yii::app()->createUrl('albums/upload', array('id'=>$value->id, 'profile'=>Yii::app()->request->getParam('profile'))); ?>" class="u_link"><span class="u_link_icon i4"></span><em>Добавить фотографию</em></a>
					<a href="<?php echo Yii::app()->createUrl('albums/update', array('id'=>$value->id, 'profile'=>Yii::app()->request->getParam('profile'))); ?>" class="u_link"><span class="u_link_icon i5"></span><em>Редактировать</em></a>
					<a href="<?php echo Yii::app()->createUrl('albums/deleteAlbum', array('id'=>$value->id, 'profile'=>Yii::app()->request->getParam('profile'))); ?>" class="u_link removeLink"><span class="u_link_icon i6"></span><em>Удалить</em></a>
				</div>
			</div>
		<?php else:?>
			<a class="u_media" href="<?php echo Yii::app()->createUrl('albums/view', array('id'=>$value->id, 'profile'=>Yii::app()->request->getParam('profile'))); ?>">
				<?php if($value->main_photo!=NULL) echo $this->material_image($value->id, $value->main_photo->name, '180', 'photos/'.$value->user_id.'/'.$value->id); ?>
				<div class="mask hover hidden"></div>
			</a>
		<?php endif;?>
		<div class="u_media_nav">
			<a href="<?php echo Yii::app()->createUrl('albums/view', array('id'=>$value->id, 'profile'=>Yii::app()->request->getParam('profile'))); ?>" class="u_media_nav_name"><?php echo $value->name ?></a>
			<p class="media_time"><i><?php echo $value->countPhotos ?></i> фотографий</p>
		</div>
	</div>
<?php endforeach; ?>
